﻿<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Trongthang" targetNamespace="http://tempuri.org/Trongthang.xsd" xmlns:mstns="http://tempuri.org/Trongthang.xsd" xmlns="http://tempuri.org/Trongthang.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:msprop="urn:schemas-microsoft-com:xml-msprop" attributeFormDefault="qualified" elementFormDefault="qualified">
  <xs:annotation>
    <xs:appinfo source="urn:schemas-microsoft-com:xml-msdatasource">
      <DataSource DefaultConnectionIndex="0" FunctionsComponentName="QueriesTableAdapter" Modifier="AutoLayout, AnsiClass, Class, Public" SchemaSerializationMode="IncludeSchema" xmlns="urn:schemas-microsoft-com:xml-msdatasource">
        <Connections>
          <Connection AppSettingsObjectName="Settings" AppSettingsPropertyName="QuanLyNhaSachConnectionString" ConnectionStringObject="" IsAppSettingsProperty="true" Modifier="Assembly" Name="QuanLyNhaSachConnectionString (Settings)" ParameterPrefix="@" PropertyReference="ApplicationSettings.quanlynhasach.Properties.Settings.GlobalReference.Default.QuanLyNhaSachConnectionString" Provider="System.Data.SqlClient" />
        </Connections>
        <Tables>
          <TableAdapter BaseClass="System.ComponentModel.Component" DataAccessorModifier="AutoLayout, AnsiClass, Class, Public" DataAccessorName="PhieuNhapTableAdapter" GeneratorDataComponentClassName="PhieuNhapTableAdapter" Name="PhieuNhap" UserDataComponentName="PhieuNhapTableAdapter">
            <MainSource>
              <DbSource ConnectionRef="QuanLyNhaSachConnectionString (Settings)" DbObjectName="QuanLyNhaSach.dbo.PhieuNhap" DbObjectType="Table" FillMethodModifier="Public" FillMethodName="Fill" GenerateMethods="Both" GenerateShortCommands="true" GeneratorGetMethodName="GetData" GeneratorSourceName="Fill" GetMethodModifier="Public" GetMethodName="GetData" QueryType="Rowset" ScalarCallRetval="System.Object, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" UseOptimisticConcurrency="true" UserGetMethodName="GetData" UserSourceName="Fill">
                <DeleteCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>DELETE FROM [dbo].[PhieuNhap] WHERE (([MaPhieuNhap] = @Original_MaPhieuNhap) AND ([MaNV] = @Original_MaNV) AND ([TongTien] = @Original_TongTien) AND ([Ngay] = @Original_Ngay) AND ((@IsNull_NhaCungCap = 1 AND [NhaCungCap] IS NULL) OR ([NhaCungCap] = @Original_NhaCungCap)))</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_MaPhieuNhap" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaPhieuNhap" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_MaNV" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaNV" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TongTien" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TongTien" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Original_Ngay" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="0" SourceColumn="Ngay" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_NhaCungCap" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="NhaCungCap" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_NhaCungCap" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="NhaCungCap" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </DeleteCommand>
                <InsertCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>INSERT INTO [dbo].[PhieuNhap] ([MaPhieuNhap], [MaNV], [TongTien], [Ngay], [NhaCungCap]) VALUES (@MaPhieuNhap, @MaNV, @TongTien, @Ngay, @NhaCungCap);
SELECT MaPhieuNhap, MaNV, TongTien, Ngay, NhaCungCap FROM PhieuNhap WHERE (MaPhieuNhap = @MaPhieuNhap)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MaPhieuNhap" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaPhieuNhap" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MaNV" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaNV" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@TongTien" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TongTien" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Ngay" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="0" SourceColumn="Ngay" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@NhaCungCap" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="NhaCungCap" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </InsertCommand>
                <SelectCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="true">
                    <CommandText>SELECT MaPhieuNhap, MaNV, TongTien, Ngay, NhaCungCap FROM dbo.PhieuNhap where month(Ngay)=month(@NGAY)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="NGAY" ColumnName="" DataSourceName="" DataTypeServer="unknown" DbType="DateTime" Direction="Input" ParameterName="@NGAY" Precision="0" Scale="0" Size="0" SourceColumn="" SourceColumnNullMapping="false" SourceVersion="Current" />
                    </Parameters>
                  </DbCommand>
                </SelectCommand>
                <UpdateCommand>
                  <DbCommand CommandType="Text" ModifiedByUser="false">
                    <CommandText>UPDATE [dbo].[PhieuNhap] SET [MaPhieuNhap] = @MaPhieuNhap, [MaNV] = @MaNV, [TongTien] = @TongTien, [Ngay] = @Ngay, [NhaCungCap] = @NhaCungCap WHERE (([MaPhieuNhap] = @Original_MaPhieuNhap) AND ([MaNV] = @Original_MaNV) AND ([TongTien] = @Original_TongTien) AND ([Ngay] = @Original_Ngay) AND ((@IsNull_NhaCungCap = 1 AND [NhaCungCap] IS NULL) OR ([NhaCungCap] = @Original_NhaCungCap)));
SELECT MaPhieuNhap, MaNV, TongTien, Ngay, NhaCungCap FROM PhieuNhap WHERE (MaPhieuNhap = @MaPhieuNhap)</CommandText>
                    <Parameters>
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MaPhieuNhap" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaPhieuNhap" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@MaNV" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaNV" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@TongTien" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TongTien" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Ngay" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="0" SourceColumn="Ngay" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@NhaCungCap" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="NhaCungCap" SourceColumnNullMapping="false" SourceVersion="Current" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_MaPhieuNhap" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaPhieuNhap" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_MaNV" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="MaNV" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@Original_TongTien" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="TongTien" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="false" AutogeneratedName="" DataSourceName="" DbType="DateTime" Direction="Input" ParameterName="@Original_Ngay" Precision="0" ProviderType="SmallDateTime" Scale="0" Size="0" SourceColumn="Ngay" SourceColumnNullMapping="false" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="Int32" Direction="Input" ParameterName="@IsNull_NhaCungCap" Precision="0" ProviderType="Int" Scale="0" Size="0" SourceColumn="NhaCungCap" SourceColumnNullMapping="true" SourceVersion="Original" />
                      <Parameter AllowDbNull="true" AutogeneratedName="" DataSourceName="" DbType="AnsiString" Direction="Input" ParameterName="@Original_NhaCungCap" Precision="0" ProviderType="VarChar" Scale="0" Size="0" SourceColumn="NhaCungCap" SourceColumnNullMapping="false" SourceVersion="Original" />
                    </Parameters>
                  </DbCommand>
                </UpdateCommand>
              </DbSource>
            </MainSource>
            <Mappings>
              <Mapping SourceColumn="MaPhieuNhap" DataSetColumn="MaPhieuNhap" />
              <Mapping SourceColumn="MaNV" DataSetColumn="MaNV" />
              <Mapping SourceColumn="TongTien" DataSetColumn="TongTien" />
              <Mapping SourceColumn="Ngay" DataSetColumn="Ngay" />
              <Mapping SourceColumn="NhaCungCap" DataSetColumn="NhaCungCap" />
            </Mappings>
            <Sources />
          </TableAdapter>
        </Tables>
        <Sources />
      </DataSource>
    </xs:appinfo>
  </xs:annotation>
  <xs:element name="Trongthang" msdata:IsDataSet="true" msdata:UseCurrentLocale="true" msprop:EnableTableAdapterManager="true" msprop:Generator_DataSetName="Trongthang" msprop:Generator_UserDSName="Trongthang">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="PhieuNhap" msprop:Generator_TableClassName="PhieuNhapDataTable" msprop:Generator_TableVarName="tablePhieuNhap" msprop:Generator_TablePropName="PhieuNhap" msprop:Generator_RowDeletingName="PhieuNhapRowDeleting" msprop:Generator_RowChangingName="PhieuNhapRowChanging" msprop:Generator_RowEvHandlerName="PhieuNhapRowChangeEventHandler" msprop:Generator_RowDeletedName="PhieuNhapRowDeleted" msprop:Generator_UserTableName="PhieuNhap" msprop:Generator_RowChangedName="PhieuNhapRowChanged" msprop:Generator_RowEvArgName="PhieuNhapRowChangeEvent" msprop:Generator_RowClassName="PhieuNhapRow">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="MaPhieuNhap" msprop:Generator_ColumnVarNameInTable="columnMaPhieuNhap" msprop:Generator_ColumnPropNameInRow="MaPhieuNhap" msprop:Generator_ColumnPropNameInTable="MaPhieuNhapColumn" msprop:Generator_UserColumnName="MaPhieuNhap">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="MaNV" msprop:Generator_ColumnVarNameInTable="columnMaNV" msprop:Generator_ColumnPropNameInRow="MaNV" msprop:Generator_ColumnPropNameInTable="MaNVColumn" msprop:Generator_UserColumnName="MaNV">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="TongTien" msprop:Generator_ColumnVarNameInTable="columnTongTien" msprop:Generator_ColumnPropNameInRow="TongTien" msprop:Generator_ColumnPropNameInTable="TongTienColumn" msprop:Generator_UserColumnName="TongTien" type="xs:int" />
              <xs:element name="Ngay" msprop:Generator_ColumnVarNameInTable="columnNgay" msprop:Generator_ColumnPropNameInRow="Ngay" msprop:Generator_ColumnPropNameInTable="NgayColumn" msprop:Generator_UserColumnName="Ngay" type="xs:dateTime" />
              <xs:element name="NhaCungCap" msprop:Generator_ColumnVarNameInTable="columnNhaCungCap" msprop:Generator_ColumnPropNameInRow="NhaCungCap" msprop:Generator_ColumnPropNameInTable="NhaCungCapColumn" msprop:Generator_UserColumnName="NhaCungCap" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//mstns:PhieuNhap" />
      <xs:field xpath="mstns:MaPhieuNhap" />
    </xs:unique>
  </xs:element>
</xs:schema>